/*************************************************
filename	: animation.h
author		: Stefan lulham
desc		: An animation is made up of a series of
			  frames.
*************************************************/
#ifndef D_ANIMATION_H
#define D_ANIMATION_H

#include <iostream>
#include <string>
#include <modules\graphics\graphics_enums.h>

using namespace std;

namespace DelGE
{
	namespace Modules
	{
		namespace Graphics
		{
			class Animation
			{
			private:
				string sName;
				int iStartFrame, iEndFrame, iCurrentFrame;
				int iDirection;
				float fFPS, fFrameTimer;
				bool bPlaying, bPaused;
				DelGEGraphics_Animation_Playstyle ePlaystyle;

			public:
				Animation();
				Animation(string sName, int iStartFrame, int iEndFrame, float fFPS = 30.0f);
				~Animation();

				void SetStartFrame(int iStartFrame);
				void SetEndFrame(int iEndFrame);
				void SetFPS(float fFPS);
				void SetPlaystyle(DelGEGraphics_Animation_Playstyle ePlaystyle);
				
				int GetStartFrame();
				int GetEndFrame();
				float GetFPS();
				float GetCurrentFrameTimer();
				int GetCurrentFrame();
				int GetNextFrame();
				int GetFrameCount();
				string GetName();
				DelGEGraphics_Animation_Playstyle GetPlaystyle();

				bool IsPlaying();

				void Start();
				void Pause();
				void Resume();
				void Stop();

				void Update(float fDelta);
			};
		}
	}
}

#endif